#ifndef _COMMAND_H
#define _COMMAND_H
#include "stm32f4xx_hal.h"
#include "w25qxx.h"
#include "test_seq.h"

#define	PARAM_BYTE		20

#define	MAX_PARAM		8

typedef struct {
    unsigned char ParamNum;
    unsigned char *pCommand;
    unsigned char CommandBytes;
    unsigned char *pParam[MAX_PARAM];
    unsigned int ParamBytes[MAX_PARAM];
} COMMAND_LINE;


typedef enum
{
    ERR_NOERR = 0,
    ERR_UNSUPPORT = 1,
    ERR_NAME,
    ERR_INPUT,
    ERR_OTHER
} CMD_ERR;

typedef struct {
    uint16_t	year;
    uint8_t		month;
    uint8_t		day;
    uint8_t		weekday;
    uint8_t		hour;
    uint8_t		minute;
    uint8_t		second;
} RTC_TIME;

extern uint8_t dut_detect;

void CommandProcess(void);

unsigned char CmpStr(unsigned char* str1,unsigned char* str2,unsigned char num);
unsigned char IsU32Str(unsigned char* pstr,unsigned char num);
int32_t StrToU32(unsigned char *pstr,unsigned char num);
unsigned char IsItemTRParam(unsigned char* param,unsigned char bytes);
void UartPushDEC(unsigned long value);
void PosToStr(TypeC_Channel input);
void CCpin_UartOutput(uint8_t *str_item, int32_t value, uint8_t *str_type, int32_t	open_limit, int32_t short_limit, uint8_t cc_vbus);

extern unsigned char DebugFlag;


#endif	//_COMMAND_H
